<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Glance Design Dashboard an Admin Panel Category Flat Bootstrap Responsive Website Template | Home ::
        w3layouts</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="Glance Design Dashboard Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design"/>
    <script type="application/x-javascript"> addEventListener("load", function () {
        setTimeout(hideURLbar, 0);
    }, false);

    function hideURLbar() {
        window.scrollTo(0, 1);
    } </script>

    <!-- Bootstrap Core CSS -->
    <link th:href="@{/css/bootstrap.css}" rel='stylesheet' type='text/css'/>

    <!-- Custom CSS -->
    <link th:href="@{/css/style.css}" rel='stylesheet' type='text/css'/>

    <!-- font-awesome icons CSS -->
    <link th:href="@{/css/font-awesome.css}" rel='stylesheet' type='text/css'/>
    <!-- //font-awesome icons CSS-->

    <!-- side nav css file -->
    <link th:href="@{/css/SidebarNav.min.css}" rel='stylesheet' type='text/css'/>
    <!-- //side nav css file -->

    <!-- js-->
    <script th:src="@{/js/jquery-1.11.1.min.js}"></script>
    <script th:src="@{/js/modernizr.custom.js}"></script>

    <!--webfonts-->
    <link href="//fonts.googleapis.com/css?family=PT+Sans:400,400i,700,700i&amp;subset=cyrillic,cyrillic-ext,latin-ext"
          rel="stylesheet">
    <!--//webfonts-->

    <!-- chart -->
    <script th:src="@{/js/Chart.js}"></script>

    <!-- //chart -->

    <!-- Metis Menu -->
    <script th:src="@{/js/metisMenu.min.js}"></script>
    <script th:src="@{/js/custom.js}"></script>
    <link th:href="@{/css/custom.css}" rel='stylesheet' type='text/css'/>
    <!--//Metis Menu -->
    <style>
        #chartdiv {
            width: 100%;
            height: 295px;
        }
    </style>
    <!--pie-chart --><!-- index page sales reviews visitors pie chart -->
    <script th:src="@{/js/pie-chart.js}"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $('#demo-pie-1').pieChart({
                barColor: '#2dde98',
                trackColor: '#eee',
                lineCap: 'round',
                lineWidth: 8,
                onStep: function (from, to, percent) {
                    $(this.element).find('.pie-value').text(Math.round(percent) + '%');
                }
            });

            $('#demo-pie-2').pieChart({
                barColor: '#8e43e7',
                trackColor: '#eee',
                lineCap: 'butt',
                lineWidth: 8,
                onStep: function (from, to, percent) {
                    $(this.element).find('.pie-value').text(Math.round(percent) + '%');
                }
            });

            $('#demo-pie-3').pieChart({
                barColor: '#ffc168',
                trackColor: '#eee',
                lineCap: 'square',
                lineWidth: 8,
                onStep: function (from, to, percent) {
                    $(this.element).find('.pie-value').text(Math.round(percent) + '%');
                }
            });


        });

    </script>
    <!-- //pie-chart --><!-- index page sales reviews visitors pie chart -->

    <!-- requried-jsfiles-for owl -->
    <script src=""></script>
    <script th:src="@{/js/owl.carousel.js}"></script>
    <script>
        $(document).ready(function () {
            $("#owl-demo").owlCarousel({
                items: 3,
                lazyLoad: true,
                autoPlay: true,
                pagination: true,
                nav: true,
            });
        });
    </script>
    <!-- //requried-jsfiles-for owl -->
</head>
<body class="cbp-spmenu-push">
<div class="main-content">
    <div class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
        <!--left-fixed -navigation-->
        <aside class="sidebar-left">
            <nav class="navbar navbar-inverse">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".collapse"
                            aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <h1><a class="navbar-brand" th:href="@{/}"><span class="fa fa-area-chart"></span>ONLINE<span
                            class="dashboard_text">Online Judge</span></a></h1>
                </div>
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="sidebar-menu">
                        <li class="header">MAIN NAVIGATION</li>
                        <li class="treeview">
                            <a th:href="@{/}">
                                <i class="fa fa-dashboard"></i> <span>个人中心</span>
                            </a>
                        </li>
                        <li class="treeview">
                            <a th:href="@{/questions/all}">
                                <i class="fa fa-laptop"></i>
                                <span>查看题目</span>
                            </a>
                        </li>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </nav>
        </aside>
    </div>
    <!--left-fixed -navigation-->

    <!-- header-starts -->
    <div class="sticky-header header-section ">
        <div class="header-left">
            <!--toggle button start-->
            <button id="showLeftPush"><i class="fa fa-bars"></i></button>
            <!--toggle button end-->
            <div class="profile_details_left"><!--notifications of menu start -->
                <ul class="nofitications-dropdown">
                    <li class="dropdown head-dpdn">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i
                                class="fa fa-envelope"></i></a>
                    </li>
                    <li class="dropdown head-dpdn" th:if="${status} == 1">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i
                                class="fa fa-bell"></i><span class="badge blue"></span></a>
                        <ul class="dropdown-menu">
                            <li>
                                <div class="notification_header">
                                    <h3>管理员申请</h3>
                                </div>
                            </li>
                            <li class="odd" th:each="user : ${users}">
                                <div class="notification_desc">
                                    <p>
                                        用户
                                        <span th:text="${user.getUsername()}"></span>
                                        请求申请为管理员
                                    </p>
                                </div>
                                <div class="notification_desc">
                                    <form class="col-md-6" th:action="@{/permission/grant/} + ${user.getUid()}"
                                          method="post">
                                        <input type="submit" value="同意">
                                    </form>
                                    <form class="col-md-6" th:action="@{/permission/refuse/} + ${user.getUid()}"
                                          method="post">
                                        <input type="submit" value="拒绝">
                                    </form>
                                    <div class="clearfix"></div>
                                </div>
                                <hr>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown head-dpdn" th:if="${status} == 0">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i
                                class="fa fa-tasks"></i></a>
                        <ul class="dropdown-menu">
                            <li>
                                <form th:action="@{/permission/request}" method="post">
                                    <input type="submit" value="点击申请管理员">
                                </form>
                                <div class="progress progress-striped active">
                                    <div class="bar green" style="width:100%;"></div>
                                </div>
                            </li>

                        </ul>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <!--notification menu end -->
            <div class="clearfix"></div>
        </div>
        <div class="header-right">

            <div class="profile_details">
                <ul>
                    <li class="dropdown profile_details_drop">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                            <div class="profile_img">
                                <span class="fa fa-users"> </span>
                                <div class="user-name">
                                    <p th:each="cookie: ${#request.getCookies()}"
                                       th:if="${cookie.getName()} == username" th:text="${cookie.getValue()}">
                                        &nbsp;
                                        <span th:text="${#request.getCookies()}"></span>
                                    </p>
                                    <span th:each="cookie: ${#request.getCookies()}"
                                          th:if="${cookie.getName()} == status" th:switch="${cookie.getValue()}">
                                        <span th:case="0">普通用户</span>
                                        <span th:case="1">管理员</span>
                                        <span th:case="-2">普通用户请注册</span>
                                    </span>
                                </div>
                                <i class="fa fa-angle-down lnr"></i>
                                <i class="fa fa-angle-up lnr"></i>
                                <div class="clearfix"></div>
                            </div>
                        </a>
                        <ul class="dropdown-menu drp-mnu" th:each="cookie: ${#request.getCookies()}"
                            th:if="${cookie.getName() == 'status' && cookie.getValue() == '-2'}">
                            <li><a th:href="@{/login}"><i class="fa fa-sign-in"></i> 登录</a></li>
                            <li><a th:href="@{/register}"><i class="fa fa-registered"></i> 注册</a></li>
                        </ul>
                        <ul class="dropdown-menu drp-mnu" th:each="cookie: ${#request.getCookies()}"
                            th:if="${cookie.getName() == 'status' && cookie.getValue() != '-2'}">
                            <li><a th:href="@{/logout}"><i class="fa fa-sign-out"></i>退出登录</a></li>
                            <li><a th:href="@{/}"><i class="fa fa-user"></i>个人中心</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
    </div>
    <!-- //header-ends -->
    <!-- main content start-->
    <div id="page-wrapper">
        <div class="main-page">

            <div class="row-one widgettable">
                <div class="col-md-12 stat">
                    <div class="content-top">
                        <div class="top-content facebook">
                            <a href="#"><i class="fa fa-truck"></i></a>
                        </div>
                        <ul class="info">
                            <li class="col-md-6"><b>1,296</b>
                                <p>答题数</p></li>
                            <li class="col-md-6"><b>647</b>
                                <p>正确数</p></li>
                            <div class="clearfix"></div>
                        </ul>
                    </div>
                    <div class="content-top">
                        <div class="top-content twitter">
                            <a href="#"><i class="fa fa-twitter"></i></a>
                        </div>
                        <ul class="info">
                            <li class="col-md-6"><b>1,997</b>
                                <p>Followers</p></li>
                            <li class="col-md-6"><b>389</b>
                                <p>Tweets</p></li>
                            <div class="clearfix"></div>
                        </ul>
                    </div>
                    <div class="content-top">
                        <div class="top-content google-plus">
                            <a href="#"><i class="fa fa-google-plus"></i></a>
                        </div>
                        <ul class="info">
                            <li class="col-md-6"><b>1,216</b>
                                <p>Followers</p></li>
                            <li class="col-md-6"><b>321</b>
                                <p>shares</p></li>
                            <div class="clearfix"></div>
                        </ul>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>

            <div class="tables">
                <div class="table-responsive bs-example widget-shadow">
                    <h4>您的题解</h4>
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>题目</th>
                            <th>查看</th>
                            <th>编辑</th>
                            <th>删除</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="answerkey: ${answerKeys}">
                            <th scope="row">
                                <a th:href="@{/question/} + ${answerkey.getQid()}"
                                   th:text="${answerkey.getQuestion().getTitle()}"></a>
                            </th>
                            <th>
                                <a th:href="@{/answers/key/} + ${answerkey.getUid()} + @{'/'} +${answerkey.getQid()}">
                                    <span class="fa fa-search"></span>
                                </a>
                            </th>
                            <td>
                                <a th:href="@{/answers/update/} + ${answerkey.getQid()}">
                                    <span class="glyphicon glyphicon-wrench"></span>
                                </a>
                            </td>
                            <td>
                                <a th:href="@{/answers/delete/} + ${answerkey.getUid()} + @{'/'} +${answerkey.getQid()}">
                                    <span class="glyphicon glyphicon-trash"></span>
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="bs-example widget-shadow" data-example-id="bordered-table">
                    <h4>您的答题记录</h4>
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>题目</th>
                            <th>最后答题时间</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="answer: ${userAnswers}">
                            <th scope="row">
                                <a th:href="@{/question/} + ${answer.getQuestion().getQid()}"
                                   th:text="${answer.getQuestion().getTitle()}"></a>
                            </th>
                            <td th:text="${answer.getDate()}"></td>
                            <td th:switch="${answer.getStatus()}">
                                <span th:case="0">错误</span>
                                <span th:case="1">部分正确</span>
                                <span th:case="2">正确</span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>


            <!-- for amcharts js -->
            <script th:src="@{/js/amcharts.js}"></script>
            <script th:src="@{/js/serial.js}"></script>
            <script th:src="@{/js/export.min.js}"></script>
            <link rel="stylesheet" th:href="@{/css/export.css}" type="text/css" media="all"/>
            <script th:src="@{/js/light.js}"></script>
            <!-- for amcharts js -->

            <script th:src="@{/js/index1.js}"></script>

        </div>
    </div>
    <!--footer-->
    <div class="footer">
        <p>&copy; 2018 Glance Design Dashboard. All Rights Reserved | Design by <a href="https://w3layouts.com/"
                                                                                   target="_blank">w3layouts</a></p>
    </div>
    <!--//footer-->
</div>

<!-- new added graphs chart js-->

<script th:src="@{/js/Chart.bundle.js}"></script>
<script th:src="@{/js/utils.js}"></script>

<script>
    var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    var color = Chart.helpers.color;
    var barChartData = {
        labels: ["January", "February", "March", "April", "May", "June", "July"],
        datasets: [{
            label: 'Dataset 1',
            backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
            borderColor: window.chartColors.red,
            borderWidth: 1,
            data: [
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor()
            ]
        }, {
            label: 'Dataset 2',
            backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
            borderColor: window.chartColors.blue,
            borderWidth: 1,
            data: [
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor()
            ]
        }]

    };

    window.onload = function () {
        var ctx = document.getElementById("canvas").getContext("2d");
        window.myBar = new Chart(ctx, {
            type: 'bar',
            data: barChartData,
            options: {
                responsive: true,
                legend: {
                    position: 'top',
                },
                title: {
                    display: true,
                    text: 'Chart.js Bar Chart'
                }
            }
        });

    };

    document.getElementById('randomizeData').addEventListener('click', function () {
        var zero = Math.random() < 0.2 ? true : false;
        barChartData.datasets.forEach(function (dataset) {
            dataset.data = dataset.data.map(function () {
                return zero ? 0.0 : randomScalingFactor();
            });

        });
        window.myBar.update();
    });

    var colorNames = Object.keys(window.chartColors);
    document.getElementById('addDataset').addEventListener('click', function () {
        var colorName = colorNames[barChartData.datasets.length % colorNames.length];
        ;
        var dsColor = window.chartColors[colorName];
        var newDataset = {
            label: 'Dataset ' + barChartData.datasets.length,
            backgroundColor: color(dsColor).alpha(0.5).rgbString(),
            borderColor: dsColor,
            borderWidth: 1,
            data: []
        };

        for (var index = 0; index < barChartData.labels.length; ++index) {
            newDataset.data.push(randomScalingFactor());
        }

        barChartData.datasets.push(newDataset);
        window.myBar.update();
    });

    document.getElementById('addData').addEventListener('click', function () {
        if (barChartData.datasets.length > 0) {
            var month = MONTHS[barChartData.labels.length % MONTHS.length];
            barChartData.labels.push(month);

            for (var index = 0; index < barChartData.datasets.length; ++index) {
                //window.myBar.addData(randomScalingFactor(), index);
                barChartData.datasets[index].data.push(randomScalingFactor());
            }

            window.myBar.update();
        }
    });

    document.getElementById('removeDataset').addEventListener('click', function () {
        barChartData.datasets.splice(0, 1);
        window.myBar.update();
    });

    document.getElementById('removeData').addEventListener('click', function () {
        barChartData.labels.splice(-1, 1); // remove the label first

        barChartData.datasets.forEach(function (dataset, datasetIndex) {
            dataset.data.pop();
        });

        window.myBar.update();
    });
</script>
<!-- new added graphs chart js-->

<!-- Classie --><!-- for toggle left push menu script -->
<script th:src="@{/js/classie.js}"></script>
<script>
    var menuLeft = document.getElementById('cbp-spmenu-s1'),
        showLeftPush = document.getElementById('showLeftPush'),
        body = document.body;

    showLeftPush.onclick = function () {
        classie.toggle(this, 'active');
        classie.toggle(body, 'cbp-spmenu-push-toright');
        classie.toggle(menuLeft, 'cbp-spmenu-open');
        disableOther('showLeftPush');
    };


    function disableOther(button) {
        if (button !== 'showLeftPush') {
            classie.toggle(showLeftPush, 'disabled');
        }
    }
</script>
<!-- //Classie --><!-- //for toggle left push menu script -->

<!--scrolling js-->
<script th:src="@{/js/jquery.nicescroll.js}"></script>
<script th:src="@{/js/scripts.js}"></script>
<!--//scrolling js-->

<!-- side nav js -->
<script th:src="@{/js/SidebarNav.min.js}"></script>
<script>
    $('.sidebar-menu').SidebarNav()
</script>
<!-- //side nav js -->

<!-- for index page weekly sales java script -->
<script th:src="@{/js/SimpleChart.js}"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    var num = [[${numberMap}]];

    var graphdata1 = {
        linecolor: "#CCA300",
        title: "Monday",
        values: num
    };

    $(function () {

        $("#Linegraph").SimpleChart({
            ChartType: "Line",
            toolwidth: "50",
            toolheight: "25",
            axiscolor: "#E6E6E6",
            textcolor: "#6E6E6E",
            showlegends: false,
            data: [graphdata1],
            legendsize: "140",
            legendposition: 'bottom',
            xaxislabel: '日期',
            title: '答题状态',
            yaxislabel: '解题数目'
        });
    });
    /*]]>*/
</script>
<!-- //for index page weekly sales java script -->


<!-- Bootstrap Core JavaScript -->
<script th:src="@{/js/bootstrap.js}"></script>
<!-- //Bootstrap Core JavaScript -->

</body>
</html>